using Cinemachine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace GameLogic
{
    public class SwitchBounds : MonoBehaviour
    {
        // Start is called before the first frame update
        void Start()
        {
            SwitchConfinerShape();
        }

        private void SwitchConfinerShape()
        {
            PolygonCollider2D polygonCollider2D = GameObject.FindGameObjectWithTag("BoundsConfiner").GetComponent<PolygonCollider2D>();
            CinemachineConfiner cinemachineConfiner = GetComponent<CinemachineConfiner>();
            cinemachineConfiner.m_BoundingShape2D = polygonCollider2D;
            cinemachineConfiner.InvalidatePathCache();
        }
    }
}
